﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AbpEntityFrameworkcore.Migrations.CustomDb
{
    /// <inheritdoc />
    public partial class _202410191332 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "AGV_Kitted",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    datekey = table.Column<DateTime>(type: "datetime2", nullable: true),
                    productorder = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    partnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    reelnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    qty = table.Column<int>(type: "int", nullable: true),
                    Bintype = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    status = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AGV_Kitted", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "AGV_MPNVSPartnumber",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Partnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    MPN = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Manufacture = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AGV_MPNVSPartnumber", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "AGV_Packing_List_Verification",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    PartnumberLotID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PartNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty_In_Packing = table.Column<long>(type: "bigint", nullable: true),
                    BinType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VerificatedQty = table.Column<long>(type: "bigint", nullable: true),
                    VerificatedResult = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VerificatedPersonal = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    VerificatedDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Note = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AGV_Packing_List_Verification", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "AGV_Reel_Bonding",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Datekey = table.Column<DateTime>(type: "datetime2", nullable: true),
                    KLTID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BinID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    SeqID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<long>(type: "bigint", nullable: true),
                    Reelnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Partnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BinType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DocumentNo = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    InputDate = table.Column<DateTime>(type: "datetime2", nullable: true),
                    PartnumberLotID = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    ReelType = table.Column<string>(type: "nvarchar(50)", nullable: true),
                    BondingPersonal = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReadByAGV = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ReadDatekey = table.Column<DateTime>(type: "datetime2", nullable: true),
                    Remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AGV_Reel_Bonding", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "View_Packing_List",
                columns: table => new
                {
                    PartnumberLotID = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PackingListNumber_Supplier = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PalletNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    DateKey = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    PartNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    BinType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<long>(type: "bigint", nullable: true),
                    VerificatedQty = table.Column<long>(type: "bigint", nullable: true),
                    VerificatedResult = table.Column<string>(type: "nvarchar(max)", nullable: false)
                },
                constraints: table =>
                {
                });

            migrationBuilder.CreateTable(
                name: "View_ToAGV_MatList",
                columns: table => new
                {
                    datekey = table.Column<DateTime>(type: "datetime2", nullable: true),
                    productorder = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Partnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Storagebin = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    requiredQty = table.Column<long>(type: "bigint", nullable: true),
                    reelqty = table.Column<int>(type: "int", nullable: true),
                    Bintype = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                });

            migrationBuilder.CreateTable(
                name: "View_toAGV_Reel",
                columns: table => new
                {
                    Reelnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Partnumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    Qty = table.Column<long>(type: "bigint", nullable: true)
                },
                constraints: table =>
                {
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "AGV_Kitted");

            migrationBuilder.DropTable(
                name: "AGV_MPNVSPartnumber");

            migrationBuilder.DropTable(
                name: "AGV_Packing_List_Verification");

            migrationBuilder.DropTable(
                name: "AGV_Reel_Bonding");

            migrationBuilder.DropTable(
                name: "View_Packing_List");

            migrationBuilder.DropTable(
                name: "View_ToAGV_MatList");

            migrationBuilder.DropTable(
                name: "View_toAGV_Reel");
        }
    }
}
